package com.hjk.common.response.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author hjk
 * 定义各种情况下会查询的异常!!!!!!!
 * @date 2019/10/4 0004 -- 20:14
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum ExceptionEnum {
    //构造方法 等同余public static final  PRICE_CANNOT_BE_NULL = new ExceptionEnum(400,"价格不能为空!");
    PRICE_CANNOT_BE_NULL(400, "价格不能为空!"),

    //查询商品分类异常时
    CATEGORY_NOT_FOUND(404, "商品分类查询为空!"),
    CATEGORY_SAVE_ERROR(500,"商品分类保存失败!"),

    //查询商品分类,请求参数pid不正确
    CATEGORY_BAO_REQUEST(400, "商品分类id不正确"),

    //查询品牌分类异常
    BRAND_NOT_FOUND(404, "品牌分类查询为空!"),

    //编辑品牌异常
    BRAND_EDIT_ERROR(500, "品牌编辑异常!"),

    //商品规格为空
    SPEC_GROUP_NOT_FIND(404, "商品规格分组为空!"),

    //编辑商品规格失败
    SPEC_GROUP_EDIT_ERROR(500, "商品规格分组编辑失败!"),

    //商品参数为空
    SPEC_PARAM_NOT_FIND(404, "商品规格参数为空!"),

    //遍历商品参数失败
    SPEC_PARAM_EDIT_ERROR(500, "商品规格参数编辑失败!"),

    //文件上传失败
    UPLOAD_FILE_ERROR(500, "文件上传失败!!"),

    //无效文件类型,文件为空 文件类型不是图片
    INVALID_FILE_TYPE(400, "无效的图片类型!"),

    //数据转换异常
    DATA_TRANSFER_ERROR(500, "数据转换异常"),

    //商品查询为空
    GOODS_NOT_FIND(404, "商品查询为空!"),

    //商品编辑失败
    GOODS_EDIT_ERROR(500, "商品编辑失败!"),

    //商品删除失败
    GOODS_DELETE_ERROR(500, "商品删除失败"),

    //添加商品异常
    GOODS_SAVE_ERROR(500, "添加商品异常"),

    //商品详情找不到spu_detail
    SPU_DETAIL_NOT_FIND(404, "商品详情找不到"),

    //sku找不到
    SKU_NOT_FIND(404, "sku找不到!"),

    //静态页面写入nginx服务器失败
    DIRECTORY_WRITER_ERROR(500, "创建静态页目录失败!"),

    //静态页生成失败
    FILE_WRITER_ERROR(500, "静态页生成失败"),
    //发送短信失败
    SEND_MESSAGE_ERROR(500, "短信发送失败"),

    //无效的用户数据
    INVALID_USER_DATA_TYPE(400, "输入的注册信息无效!"),

    //验证错误
    INVALID_VERIFY_CODE(500, "验证码输入错误!"),

    //注册用户失败
    INSERT_USER_OPERATION_FAIL(500,"注册用户失败!"),

    //用户名或者密码错误
    INVALID_USERNAME_PASSWORD(400,"用户名或者密码错误"),

    //非法登录,权限不足
    UNAUTHORIZED(401,"非法凭证,权限不足!"),

    //购物车参数错误
    CART_BAO_REQUEST(400,"购物车参数错误!"),

    //购物车删除失败
    CART_DELETE_ERROR(500,"购物车删除失败"),

    //购物车为空
    CART_NOT_FIND(404,"购物车商品找不到!"),

    //地址查询为空
    ADDRESS_NOT_FIND(404,"地址找不到!"),

    //保存地址失败
    ADDRESS_EDIT_ERROR(500,"保存地址失败"),

    //订单查询不到
    ORDER_NOT_FOUND(404,"订单找不到"),
    ORDER_DETAIL_NOT_FOUND(404,"订单详情找不到"),
    //插入订单失败
    INSERT_ORDER_OPEATION_FAIL(500,"插入订单失败!"),
    INVALID_ORDER_STATUS(500,"订单状态异常"),
    INVALID_NOTIFY_SIGN(500,"微信签名有误"),
    INVALID_NOTIFY_PARAM(500,"回调参数中必须包含订单编号和订单金额"),
    UPDATE_OPERATION_FAIL(500,"更新订单状态失败")
    ;


    /**
     * 状态码
     */
    private int code;
    /**
     * 错误信息
     */
    private String message;

}
